/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include "场景/场景.h"
#include "UI/布局.h"
#include "UI/Widget.h"
#include "UI/ui绘制模板.h"

#include <atomic>
#include <mutex>



class C_3D视口 : public C_Widget {
	std::thread m_线程;

	
public:
	C_3D视口(S_UI创建环境& ctx, S_设备环境& Ctx3D);
	~C_3D视口();

	S_Scene*		m_Scene;
	S_Surface3D*	m_Face;
	
	//S_2D笔刷		m_笔刷;
	ui_绘制模板_画预设图形 m_框部件;
	ui_绘制模板_纹理	   m_视口纹理绘制;

	std::mutex		m_锁;

	S_摄像机*		_m_默认镜头;
	S_摄像机*		m_镜头;
	fp_Widget更新	mf_场景外部更新回调;
	//fp_Widget更新	mf_场景外部更新回调;
	//HANDLE				m_hThread;
	//HANDLE				m_hMutex;

	std::atomic_bool	m_正在渲染;
	std::atomic_bool	m_退出渲染;
	uint8				m_帧ID;
	bool				m_部件以绘;
	bool				m_开启光追;
	bool                m_使用全局采样参数;

	void f_渲染();
};







